//
//  PersonInfoCommonFunc.m
//  GasCome
//
//  Created by zfc on 2020/4/27.
//  Copyright © 2020 zfc. All rights reserved.
//

#import "PersonInfoCommonFunc.h"

@implementation PersonInfoCommonFunc

+ (void)changePersonInfo:(NSArray *)keys value:(NSArray *)values successBlock:(void (^)(NSDictionary *response))successBlock failureBlock:(void (^)(NSError *error))failureBlock {
    NSString *url = [NSString stringWithFormat:@"/api/tiny-shop/v1/member/member/update?id=%@", [UserAccountManager shared].user.member.ID];
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    for (int i = 0; i < keys.count; i ++) {
        params[keys[i]] = values[i];
    }

    [[NetWorksTools shared] requestWithMethod:PUT url:url params:params successBlock:^(NSDictionary * _Nonnull response) {
        [SVProgressHUD showInfoWithStatus:@"个人信息修改成功"];
        if (successBlock) {
            successBlock(response);
        }
    } failureBlock:^(NSError * _Nonnull error) {
        if (failureBlock) {
            failureBlock(error);
        }
    }];

}

@end
